package com.leaf.user.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

import com.leaf.user.rule.LeafRule;
import com.netflix.loadbalancer.IRule;

@Configuration
public class ContextConfiguration {
	
	@Bean
	@LoadBalanced // 负载均衡
	public RestTemplate restTemplate() {
		return new RestTemplate();
	}
	
	@Bean
	public IRule iRule() {
		return new LeafRule();
	}

}
